package com.liuzh.deviceinfo.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Shader;
import android.graphics.Shader.TileMode;
import android.util.AttributeSet;
import android.widget.ScrollView;

import c.f.a.a.a.a;
import c.h.a.m0.h;

public class SettingsPageScrollView extends ScrollView {
    public Paint a;
    public final int b = h.t(240.0f, getResources().getDisplayMetrics());

    public SettingsPageScrollView(Context context) {
        super(context);
    }

    public SettingsPageScrollView(Context context, AttributeSet attrs) {
        super(context, attrs);
        h.t(100.0f, getResources().getDisplayMetrics());
        Paint paint = new Paint(1);
        this.a = paint;
        paint.setShader(a());
    }

    public SettingsPageScrollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public SettingsPageScrollView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    public final Shader a() {
        return new LinearGradient(0.0f, (float) getScrollY(), 0.0f, (float) (getScrollY() + this.b), a.n(getContext(), 2130969271), 0, TileMode.CLAMP);
    }

    @Override
    public void draw(Canvas canvas) {
        canvas.drawRect(0.0f, (float) getScrollY(), (float) getWidth(), (float) (getScrollY() + this.b), this.a);
        super.draw(canvas);
    }

    @Override
    public void onScrollChanged(int i, int i2, int i3, int i4) {
        super.onScrollChanged(i, i2, i3, i4);
        this.a.setShader(a());
    }
}
